// Define namespace

Common.Action = {}


/**
 *
 */

Common.Action.call = function(extensionId, objectName, methodName, methodArguments)
{
	// Build the URL
	
	var url = '<?php p(root(false)); ?>';
	
	if (extensionId != null)
	{
		url += '[' + extensionId + ']/';
	}

	url += 'action/' + objectName + '.' + methodName;

	var separator = '?';

	for (i in methodArguments)
	{
		url += separator + i + '=' + methodArguments[i];
		separator = '&';
	}

	
	// Redirect to the URL
	
	$("body").fadeOut
	(
		100,
		function()
		{
			document.location.href = url;
		}
	);
}
